Skip to content

Conversation

@tinatorabi
Copy link
Collaborator

Added a refactor frequency parameter: refactor_freq.
TO DO: add the automatic triggering condition based on max(R_ii)/min(R_ii).

@tinatorabi tinatorabi requested a review from cortner October 6, 2025 19:33
Copy link
Collaborator

@cortner cortner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some questions, nothing blocking I think...

src/BPDual.jl Outdated
function Base.show(io::IO, t::ASPTracer)
nsteps = length(t.iteration)
nvars = isempty(t.solution) ? 0 : length(t.solution[end].nzind)
println(io, "ASPTracer with $nvars active variables at final step.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would output it a bit differently, something like

ASPTracer(maxactive = ...)

or something like that.

src/BPDual.jl Outdated
cur_r_size +=1
cur_r_size +=1
if itn % refactor_freq == 0 && cur_r_size > 0
F = qr!(S[:, 1:cur_r_size])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really safe to do this in-place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess it would be better to copy?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if in-place is safe then in-place is better. I just wanted to be certain that you are certain about it. But it overwrite S; so if S is just a buffer that gets overwritten again before the next qr! then it's fine.

src/BPDual.jl Outdated
cur_r_size -=1
cur_r_size -=1
if itn % refactor_freq == 0 && cur_r_size > 0
F = qr!(S[:, 1:cur_r_size])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same as above)

src/omp.jl Outdated
cur_r_size +=1

if itn % refactor_freq == 0 && cur_r_size > 0
F = qr!(S[:, 1:cur_r_size])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same)


# Solve the basis pursuit problem
tracer = asp_bpdn(A, b, 0.0, loglevel =0);
tracer = asp_bpdn(A, b, 0.0, loglevel =0, refactor_freq =20);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be tests with and without refactor? Could one design a test that requires a refactor?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could add a test where the columns of A are nearly linearly dependent..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants